package com.tczs.web.config;

import org.apache.log4j.Logger;

import java.io.*;
import java.util.Properties;

public class MessageEnZhData {
    private static Logger logger = Logger.getLogger(MessageEnZhData.class);

    private static final Properties properties = new Properties();

    public static void init(){
        // 使用InPutStream流读取properties文件
        try {
            InputStream resourceAsStream = MessageEnZhData.class.getClassLoader().getResourceAsStream("message_en_zh.properties");
            properties.load(new InputStreamReader(resourceAsStream,"UTF-8"));
            logger.info("message zh to en config load success");
        } catch (IOException e) {
            logger.error("message zh to en config load error",e);
        }
    }

    public static String get(String key){
        key = key.replace(" ","");
        return properties.getProperty(key);
    }

}
